package metier;

public class Compte {
	
	private int code;
	protected float solde;
	private static int nbComptes;
	
	public Compte(float solde) {
		++nbComptes;
		code = nbComptes;
		this.solde = solde;
	}
	
	public void verser(float mnt) {
		solde += mnt;
	}
	
	public void retirer(float mnt) {
		if (mnt < solde) {
			solde -= mnt;
		} else {
			System.out.println("Solde insuffisant");
		}
	}

	@Override
	public String toString() {
		return "Code=" + code + ", solde=" + solde;
	}
	
	public void aa() {
		System.out.println("Compte.aa()");
	}
}
